<template>
	<view>
		<text class="prices" :style="priceStyle">￥<text class="u-font-30">{{prices | left}}</text><text class="u-font-26">{{prices | right}}</text></text>
	</view>
</template>

<script>
	export default {
		props: {
			prices: {
				type: [Number,String],
				default: ''
			},
			textColor:{
				type:String,
				default: 'red'
			},
			through:{
				type:Boolean,
				default:false
			}
		},
		computed:{
			priceStyle(){
				let style={
					color:this.textColor,
					'text-decoration': this.through?'line-through':''
				}
				return style
			}
		},
		filters: {
			left(value) {
				return value.toString().split('.')[0]+'.';
			},
			right(value) {
				return value.toString().split('.')[1];
			}
		},
		data() {
			return {
				
			};
		}
	}
</script>

<style scoped>

</style>
